package nsoft.nschoolingbook.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import nsoft.nschoolingbook.object.Constant;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

public class MainController extends AbstractController{
	public static final String PARAM_PAGE="page";
	public static final String PARAM_VAL_MAIN="main";
	
	@Override
	protected ModelAndView handleRequestInternal(
			HttpServletRequest req,
			HttpServletResponse resp) throws Exception {
		String pageType=req.getParameter(PARAM_PAGE)!=null?
				req.getParameter(PARAM_PAGE):Constant.EMPTY;
		
		Map<String, Object> data=new HashMap<String, Object>();
		
		if (pageType.equals(Constant.EMPTY)||
				pageType.equals(PARAM_VAL_MAIN)){
			return new ModelAndView(PARAM_VAL_MAIN,data);
		}
		
		return null;
	}
	
}
